
package com.joysuch.wwyt.core.quartz;

import javax.transaction.Transactional;

import com.joysuch.wwyt.core.repository.BaseBizCodeSeedDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class ResetTimeSequenceBizCodesSeedJob {
    private static final Logger logger = LoggerFactory.getLogger(ResetTimeSequenceBizCodesSeedJob.class);
    @Autowired
    private BaseBizCodeSeedDao bizCodeSeedDao;

    @Transactional
    @Scheduled(cron = "0 0 0 * * ?")
    public void reset() {
        try {
            logger.info("开始重置消息序列相关的种子");
            bizCodeSeedDao.resetDailyTypeSeed();
            logger.info("完成重置消息序列相关的种子");
        } catch (Exception e) {
            logger.error("重置种子出错", e);
        }
    }
}
